package com.zlj.accountant.app.weiget;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.zlj.accountant.R;

public abstract class LabelText extends LinearLayout {
	
	TextView txt_leb,txt_val;
	
	public LabelText(Context context, AttributeSet attrs) {
		super(context, attrs);
		LayoutInflater.from(getContext()).inflate(R.layout.lyt_wg_labeltext,this,true);
		txt_leb = (TextView) findViewById(R.id.leb);
		txt_val = (TextView) findViewById(R.id.txt);		
		TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Report_Label);
		txt_leb.setText(a.getString(R.styleable.Report_Label_label_text));
		txt_val.setText(a.getString(R.styleable.Report_Label_label_value));
	}
	
	
	public LabelText(Context context,String labStr) {
		super(context);
		LayoutInflater.from(getContext()).inflate(R.layout.lyt_wg_labeltext,this,true);
		txt_leb = (TextView) findViewById(R.id.leb);
		txt_val = (TextView) findViewById(R.id.txt);		
		txt_leb.setText(labStr);
	}
	
	
	protected void setValue(String val){
		txt_val.setText(val+"");
	}
	
	public void setLable(String lab){
		txt_leb.setText(lab);
	}

}
